import pdfkit


options = {
    'page-size': 'A4',
    'margin-top': '0.1in',
    'margin-right': '0.1in',
    'margin-bottom': '0.1in',
    'margin-left': '0.1in',
    'encoding': "UTF-8",
    'no-outline': None,
    'quiet': ''
    # 'custom-header' : [
    #     ('Accept-Encoding', 'gzip')
    # ],
    # 'cookie': [
    #     ('cookie-name1', 'cookie-value1'),
    #     ('cookie-name2', 'cookie-value2'),
    # ],
    # 'no-outline': None
}
# url = 'https://www.youtube.com/watch?v=CdpSWSS3dw8'
url = 'https://kinwork.jp/'
config = pdfkit.configuration(wkhtmltopdf="E:\work\pycharm\wkhtmltopdf.exe")
# 指定wkhtmltopdf的路径
pdfkit.from_url(url, 'output5.pdf', configuration=config, options=options)


# pdfkit.from_file('アンドロイド 求人 _ K i n W o r k.html', 'output.pdf', configuration=confg)
